//
//  MainViewController.m
//  Pad-test
//
//  Created by jjkj on 17/3/2.
//  Copyright © 2017年 jjkj. All rights reserved.
//

#import "MainViewController.h"
#import "ChartViewController.h"
#import "TimeViewController.h"
#import "U3dViewController.h"
#import "EquipmentViewController.h"
#import "NoteViewController.h"
#import "MessageViewController.h"
#import "SearchViewController.h"

@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self TopView];
    
    [self LeftView];
}

//上部视图
- (void)TopView{
    
    //上部整体
    UIView *TopView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreen_Width, 149)];
    TopView.backgroundColor = [UIColor blueColor];
    
    [self.view addSubview:TopView];
    
    //头像
    UIImageView *HeadImgView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 30, 100, 100)];
    HeadImgView.image = [UIImage imageNamed:@"head"];
    
    //作业长
    UILabel *Worker = [[UILabel alloc]initWithFrame:CGRectMake(120, 50, 100, 30)];
    UILabel *WorkerMan = [[UILabel alloc]initWithFrame:CGRectMake(120, 100, 100, 30)];
    Worker.text = @"作业长";
    WorkerMan.text = @"张国服";
    Worker.textColor = [UIColor whiteColor];
    WorkerMan.textColor = [UIColor whiteColor];
    
    //时间
    UILabel *Time = [[UILabel alloc]initWithFrame:CGRectMake(200, 80, 300, 69)];
    Time.text = @"2017年02月14日";
    Time.font = [UIFont systemFontOfSize:30];
    Time.textColor = [UIColor whiteColor];
    
    [self.view addSubview:HeadImgView];
    [self.view addSubview:Worker];
    [self.view addSubview:WorkerMan];
    [self.view addSubview:Time];
    
    //值班主任
    UILabel *Director = [[UILabel alloc]initWithFrame:CGRectMake(450, 80, 130, 69)];
    UILabel *DirectorMan = [[UILabel alloc]initWithFrame:CGRectMake(550, 80, 80, 69)];
    Director.text = @"值班主任:";
    DirectorMan.text = @" 高冰冰";
    Director.font = [UIFont systemFontOfSize:22];
    DirectorMan.font = [UIFont systemFontOfSize:22];
    Director.textColor = [UIColor whiteColor];
    DirectorMan.textColor = [UIColor whiteColor];
    
    [self.view addSubview:Director];
    [self.view addSubview:DirectorMan];
    
    //班长
    UILabel *Monitor = [[UILabel alloc]initWithFrame:CGRectMake(660, 80, 80, 69)];
    UILabel *MonitorMen = [[UILabel alloc]initWithFrame:CGRectMake(710, 80, 170, 69)];
    Monitor.text = @"班长:";
    MonitorMen.text = @" 赵云飞 孔令辉";
    Monitor.font = [UIFont systemFontOfSize:22];
    MonitorMen.font = [UIFont systemFontOfSize:22];
    Monitor.textColor = [UIColor whiteColor];
    MonitorMen.textColor = [UIColor whiteColor];
    
    [self.view addSubview:Monitor];
    [self.view addSubview:MonitorMen];
    
    //调度
    UILabel *Dispatcher = [[UILabel alloc]initWithFrame:CGRectMake(910, 80, 80, 69)];
    UILabel *DispatcherMan = [[UILabel alloc]initWithFrame:CGRectMake(970, 80, 80, 69)];
    Dispatcher.text = @"调度:";
    DispatcherMan.text = @" 郝调度";
    Dispatcher.font = [UIFont systemFontOfSize:22];
    DispatcherMan.font = [UIFont systemFontOfSize:22];
    Dispatcher.textColor = [UIColor whiteColor];
    DispatcherMan.textColor = [UIColor whiteColor];
    
    [self.view addSubview:Dispatcher];
    [self.view addSubview:DispatcherMan];
}

//左侧视图
- (void)LeftView{
    
//--------------设备运行曲线--------------
    UIButton *TimeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    TimeBtn.frame = CGRectMake(0, 149, 190, 125);
    TimeBtn.backgroundColor = [UIColor blueColor];
    
     [TimeBtn setTitle:@"设备运行曲线" forState:UIControlStateNormal];
     TimeBtn.titleEdgeInsets = UIEdgeInsetsMake(80, 0, 0, 0);
    //[TimeBtn setImage:[UIImage imageNamed:@"btn"] forState:UIControlStateNormal];
    //TimeBtn.titleEdgeInsets = UIEdgeInsetsMake(TimeBtn.imageView.frame.size.height, TimeBtn.imageView.frame.size.width, 0, 0);
    //TimeBtn.imageEdgeInsets = UIEdgeInsetsMake(TimeBtn.titleLabel.frame.size.height, 0, 0, TimeBtn.titleLabel.bounds.size.width);
    
    [TimeBtn addTarget:self action:@selector(Time) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:TimeBtn];
    
//--------------三位地理平台--------------
    UIButton *U3dBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    U3dBtn.frame = CGRectMake(0, 274, 190, 125);
    U3dBtn.backgroundColor = [UIColor blueColor];
    //[TimeBtn setImage:[UIImage imageNamed:@"btn"] forState:UIControlStateNormal];
    //TimeBtn.imageEdgeInsets = UIEdgeInsetsMake(30, 30, 50, 10);
    [U3dBtn setTitle:@"三位地理平台" forState:UIControlStateNormal];
    U3dBtn.titleEdgeInsets = UIEdgeInsetsMake(80, 0, 0, 0);
    [U3dBtn addTarget:self action:@selector(U3d) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:U3dBtn];
    
//--------------产量统计报表--------------
    UIButton *ProBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    ProBtn.frame = CGRectMake(0, 399, 190, 125);
    ProBtn.backgroundColor = [UIColor blueColor];
    //[TimeBtn setImage:[UIImage imageNamed:@"btn"] forState:UIControlStateNormal];
    //TimeBtn.imageEdgeInsets = UIEdgeInsetsMake(30, 30, 50, 10);
    [ProBtn setTitle:@"产量统计报表" forState:UIControlStateNormal];
    ProBtn.titleEdgeInsets = UIEdgeInsetsMake(80, 0, 0, 0);
    [ProBtn addTarget:self action:@selector(Pro) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:ProBtn];
    
//--------------设备状况统计--------------
    UIButton *EquBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    EquBtn.frame = CGRectMake(0, 524, 190, 125);
    EquBtn.backgroundColor = [UIColor blueColor];
    //[TimeBtn setImage:[UIImage imageNamed:@"btn"] forState:UIControlStateNormal];
    //TimeBtn.imageEdgeInsets = UIEdgeInsetsMake(30, 30, 50, 10);
    [EquBtn setTitle:@"设备状况统计" forState:UIControlStateNormal];
    EquBtn.titleEdgeInsets = UIEdgeInsetsMake(80, 0, 0, 0);
    [EquBtn addTarget:self action:@selector(Equ) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:EquBtn];
    
//--------------调度日志--------------
    UIButton *NoteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    NoteBtn.frame = CGRectMake(0, 649, 190, 125);
    NoteBtn.backgroundColor = [UIColor blueColor];
    //[TimeBtn setImage:[UIImage imageNamed:@"btn"] forState:UIControlStateNormal];
    //TimeBtn.imageEdgeInsets = UIEdgeInsetsMake(30, 30, 50, 10);
    [NoteBtn setTitle:@"调度日志" forState:UIControlStateNormal];
    NoteBtn.titleEdgeInsets = UIEdgeInsetsMake(80, 0, 0, 0);
    [NoteBtn addTarget:self action:@selector(Note) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:NoteBtn];
    
//--------------消息--------------
    UIButton *MsgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    MsgBtn.frame = CGRectMake(0, 774, 190, 125);
    MsgBtn.backgroundColor = [UIColor blueColor];
    //[TimeBtn setImage:[UIImage imageNamed:@"btn"] forState:UIControlStateNormal];
    //TimeBtn.imageEdgeInsets = UIEdgeInsetsMake(30, 30, 50, 10);
    [MsgBtn setTitle:@"消息" forState:UIControlStateNormal];
    MsgBtn.titleEdgeInsets = UIEdgeInsetsMake(80, 0, 0, 0);
    [MsgBtn addTarget:self action:@selector(Msg) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:MsgBtn];
    
//--------------综合搜索--------------
    UIButton *SearchBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    SearchBtn.frame = CGRectMake(0, 899, 190, 125);
    SearchBtn.backgroundColor = [UIColor blueColor];
    //[TimeBtn setImage:[UIImage imageNamed:@"btn"] forState:UIControlStateNormal];
    //TimeBtn.imageEdgeInsets = UIEdgeInsetsMake(30, 30, 50, 10);
    [SearchBtn setTitle:@"综合搜索" forState:UIControlStateNormal];
    SearchBtn.titleEdgeInsets = UIEdgeInsetsMake(80, 0, 0, 0);
    [SearchBtn addTarget:self action:@selector(Search) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:SearchBtn];
}

//添加点击事件
- (void)Time{
    
    TimeViewController *TimeVC = [[TimeViewController alloc]initWithNibName:@"TimeViewController" bundle:nil];
    [self addChildViewController:TimeVC];
    [self.view addSubview:TimeVC.view];
    
}
- (void)U3d{
    
    U3dViewController *U3dVC = [[U3dViewController alloc]init];
    [self addChildViewController:U3dVC];
    [self.view addSubview:U3dVC.view];
    
}
- (void)Pro{
    
    ChartViewController *ChartVC = [[ChartViewController alloc]init];
    [self addChildViewController:ChartVC];
    [self.view addSubview:ChartVC.view];

}
- (void)Equ{
    
    EquipmentViewController *EquiptionVC = [[EquipmentViewController alloc]init];
    [self addChildViewController:EquiptionVC];
    [self.view addSubview:EquiptionVC.view];
    
}
- (void)Note{
    
    NoteViewController *NoteVC = [[NoteViewController alloc]init];
    [self addChildViewController:NoteVC];
    [self.view addSubview:NoteVC.view];
    
}
- (void)Msg{
    
    MessageViewController *MessageVC = [[MessageViewController alloc]init];
    [self addChildViewController:MessageVC];
    [self.view addSubview:MessageVC.view];
    
}
- (void)Search{
    
    SearchViewController *SearchVC = [[SearchViewController alloc]init];
    [self addChildViewController:SearchVC];
    [self.view addSubview:SearchVC.view];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}








@end
